//
//  KABTicCheResultTCell.m
//  kabu
//
//  Created by XiangDongMBP on 2017/2/16.
//  Copyright © 2017年 East. All rights reserved.
//

#import "KABTicCheResultTCell.h"
#import "KABModel.h"

@implementation KABTicCheResultTCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)configViewWithOrderDetail:(KABExhOrderDetail *)detail index:(NSInteger)index {
    NSArray *titleArray = @[@"常用手机号",
                            @"展会名称",
                            @"展会时间",
                            @"展会地址",
                            @"门票单价",
                            @"门票数量",
                            @"门票总价",
                            @"门票类型",
                            @"订单号"];
    NSString *time = [NSString stringWithFormat:@"%@-%@", detail.exhibition_starttime, detail.exhibition_endtime];
    NSString *number = [NSString stringWithFormat:@"x%zd", detail.number];
    NSString *price = [NSString stringWithFormat:@"￥%.2f", detail.price / 100.0];
    NSString *total_price = [NSString stringWithFormat:@"￥%.2f", detail.total_price / 100.0];
    NSArray *dataArray = @[detail.phone_number,
                           detail.exhibition_name,
                           time,
                           detail.exhibition_address,
                           price,
                           number,
                           total_price,
                           detail.ticket_type,
                           detail.orderId];
    
    if (index < titleArray.count) {
        self.titleLabel.text = titleArray[index];
    }
    if (index < dataArray.count) {
        self.infoLabel.text = dataArray[index];
    }
}

@end
